package cn.changeforyou.web.cloud.auth.exception;

import cn.changeforyou.base.exception.ErrorInfo;
import cn.changeforyou.base.model.Module;

public enum AuthExceptionEnum implements ErrorInfo {

    //这个在CommonResultEnum
//    TOKEN_NOT_EXIST(1, "token不存在"),
    NOT_FOUND_USER(2, "用户不存在"),
    PASSWORD_ERROR(3, "密码错误"),
    TOKEN_EXPIRED(4, "token过期"),
    TOKEN_ERROR(5, "token错误"),
    ;

    AuthExceptionEnum(int unitCode, String message) {
        this.unitCode = unitCode;
        this.message = message;
    }

    private final int unitCode;
    private final String message;

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public Module getModule() {
        return Module.AUTH_SERVICE;
    }

    @Override
    public int unitCode() {
        return unitCode;
    }

}
